home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / inptmthd.sit / Input Methods / card_4153.txt < prev    next >
Text File  |  1989-11-24  |  13KB  |  555 lines

  1. -- card: 4153 from stack: in
  2. -- bmap block id: 4573
  3. -- flags: 0000
  4. -- background id: 2696
  5. -- name: Move Objects
  6. ----- HyperTalk script -----
  7. on closeCard
  8.   global movedList
  9.   lock screen
  10.   show button "Hex" at loc of card field "HexStart"
  11.   repeat with w = 1 to 3
  12.     put "Word" & w into fieldName
  13.     put fieldName & " Start" into startField
  14.     show cd fld fieldName at the loc of card field startField
  15.   end repeat
  16.   repeat with w = 1 to 4
  17.     put "Alph" & w into fieldName
  18.     put fieldName & " Start" into startField
  19.     show cd fld fieldName at the loc of card field startField
  20.   end repeat
  21.   put empty into movedList
  22.   pass closeCard
  23. end closeCard
  24.  
  25.  
  26. --ΓÇöΓÇöΓÇöΓÇöΓÇöΓÇöΓÇöΓÇö--
  27. -- MoveMe --
  28. --ΓÇöΓÇöΓÇöΓÇöΓÇöΓÇöΓÇöΓÇö--
  29. -- created by Jim Taylor  2/89
  30. -- Microcomputer Support for Curriculum
  31. -- 101 HRCB, Brigham Young University, Provo, UT 84602  (801)378-6446
  32. -- taylorj@byuvax.bitnet
  33. --
  34. -- This code has been released into the public domain.
  35. --
  36. -- Lets the user moves a button or field.
  37. -- Must be called on mouseDOWN.
  38. -- Make the "start" and "correct" fields BEFORE you make the
  39. -- object, so it will be in front of them.
  40. --
  41. on moveMe startField, correctField
  42.   if the loc of target is within the rect of cd fld correctField
  43.   then exit moveMe  -- don't move if already in correct spot
  44.   repeat until the mouse is up
  45.     show target at the mouseLoc
  46.   end repeat
  47.   if the loc of target is within the rect of cd fld correctField then
  48.     show target at the loc of card field correctField
  49.     rightSound
  50.   else
  51.     wrongSound
  52.     show target at the loc of card field startField
  53.   end if
  54. end moveMe
  55.  
  56.  
  57. on alphabetize fieldName
  58.   global movedList
  59.  
  60.   -- move the word
  61.   repeat until the mouse is up
  62.     show target at the mouseLoc
  63.   end repeat
  64.  
  65.   -- see if it's in one of the boxes
  66.   put empty into inBox
  67.   repeat with w = 1 to 4
  68.     put "Alph" & w & " Correct" into boxField
  69.     if the loc of cd fld fieldName is within the rect of cd fld boxField then put boxField into inBox
  70.   end repeat
  71.   if inbox is empty then  -- not in box, put it back
  72.     put fieldName & " Start" into startField
  73.     show cd fld fieldName at the loc of card field startField
  74.   else  -- in box, center it and remember that we moved it
  75.     show cd fld fieldName at the loc of card field inBox
  76.     if fieldName & "," is not in movedList then
  77.       put fieldName & "," after movedList
  78.     end if
  79.   end if
  80.  
  81.   -- if all the words have been moved, check them
  82.   if number of items in movedList is 4 then
  83.     put true into allCorrect
  84.     repeat with w = 1 to 4
  85.       put "Alph" & w into fieldName
  86.       put fieldName & " Correct" into correctField
  87.       if the loc of cd fld fieldName is not within the rect of cd fld correctField then put false into allCorrect
  88.     end repeat
  89.     if allCorrect then
  90.       rightSound
  91.     else
  92.       wrongSound
  93.       repeat with w = 1 to 4  -- put them all back
  94.         put "Alph" & w into fieldName
  95.         put fieldName & " Start" into startField
  96.         show cd fld fieldName at the loc of card field startField
  97.       end repeat
  98.       put empty into movedList
  99.     end if
  100.   end if
  101. end alphabetize
  102.  
  103.  
  104.  
  105.  
  106. -- part 2 (field)
  107. -- low flags: 01
  108. -- high flags: 0000
  109. -- rect: left=62 top=99 right=135 bottom=99
  110. -- title width / last selected line: 0
  111. -- icon id / first selected line: 0 / 0
  112. -- text alignment: 0
  113. -- font id: 3
  114. -- text size: 12
  115. -- style flags: 0
  116. -- line height: 16
  117. -- part name: HexStart
  118.  
  119.  
  120. -- part 3 (field)
  121. -- low flags: 01
  122. -- high flags: 0000
  123. -- rect: left=20 top=129 right=147 bottom=39
  124. -- title width / last selected line: 0
  125. -- icon id / first selected line: 0 / 0
  126. -- text alignment: 0
  127. -- font id: 3
  128. -- text size: 12
  129. -- style flags: 0
  130. -- line height: 16
  131. -- part name: HexCorrect
  132.  
  133.  
  134. -- part 1 (button)
  135. -- low flags: 00
  136. -- high flags: 0000
  137. -- rect: left=65 top=101 right=133 bottom=95
  138. -- title width / last selected line: 0
  139. -- icon id / first selected line: 7558 / 7558
  140. -- text alignment: 1
  141. -- font id: 0
  142. -- text size: 12
  143. -- style flags: 0
  144. -- line height: 16
  145. -- part name: Hex
  146. ----- HyperTalk script -----
  147. on mouseDown
  148.   moveMe HexStart, HexCorrect
  149. end mouseDown
  150.  
  151.  
  152.  
  153. -- part 5 (button)
  154. -- low flags: 00
  155. -- high flags: 0000
  156. -- rect: left=40 top=213 right=274 bottom=100
  157. -- title width / last selected line: 0
  158. -- icon id / first selected line: 0 / 0
  159. -- text alignment: 1
  160. -- font id: 0
  161. -- text size: 12
  162. -- style flags: 0
  163. -- line height: 16
  164. -- part name: Smiley
  165. ----- HyperTalk script -----
  166. on mouseDown
  167.   choose select tool
  168.   drag from topLeft of me to bottomRight of me
  169.   doMenu "Select"  --tighten selection
  170.   put the loc of me into oldLoc
  171.   put oldLoc into newLoc  -- just in case they mouse up quickly
  172.   put "10,10," & width of card window - 20 & "," & height of card window - 20 into bounds
  173.   repeat until the mouse is up
  174.     put the mouseLoc into newLoc
  175.     if newLoc is within bounds then --ignore if moved out of window
  176.       drag from oldLoc to newLoc
  177.       put newLoc into oldLoc
  178.     end if
  179.   end repeat
  180.   if newLoc is within the rect of card field "CorrectLoc2" then
  181.     drag from newLoc to the loc of card field "CorrectLoc2"
  182.     rightSound
  183.     wait 1 second
  184.   else
  185.     wrongSound
  186.   end if
  187.   doMenu "Undo"
  188.   choose browse tool
  189. end mouseDown
  190.  
  191.  
  192.  
  193. -- part 6 (field)
  194. -- low flags: 01
  195. -- high flags: 0000
  196. -- rect: left=297 top=272 right=329 bottom=344
  197. -- title width / last selected line: 0
  198. -- icon id / first selected line: 0 / 0
  199. -- text alignment: 0
  200. -- font id: 3
  201. -- text size: 12
  202. -- style flags: 0
  203. -- line height: 16
  204. -- part name: CorrectLoc2
  205.  
  206.  
  207. -- part 11 (field)
  208. -- low flags: 01
  209. -- high flags: 0000
  210. -- rect: left=206 top=62 right=87 bottom=265
  211. -- title width / last selected line: 0
  212. -- icon id / first selected line: 0 / 0
  213. -- text alignment: 0
  214. -- font id: 3
  215. -- text size: 12
  216. -- style flags: 0
  217. -- line height: 16
  218. -- part name: Word3 Start
  219.  
  220.  
  221. -- part 12 (field)
  222. -- low flags: 01
  223. -- high flags: 0000
  224. -- rect: left=270 top=62 right=87 bottom=329
  225. -- title width / last selected line: 0
  226. -- icon id / first selected line: 0 / 0
  227. -- text alignment: 0
  228. -- font id: 3
  229. -- text size: 12
  230. -- style flags: 0
  231. -- line height: 16
  232. -- part name: Word1 Start
  233.  
  234.  
  235. -- part 13 (field)
  236. -- low flags: 01
  237. -- high flags: 0000
  238. -- rect: left=336 top=62 right=87 bottom=395
  239. -- title width / last selected line: 0
  240. -- icon id / first selected line: 0 / 0
  241. -- text alignment: 0
  242. -- font id: 3
  243. -- text size: 12
  244. -- style flags: 0
  245. -- line height: 16
  246. -- part name: Word2 Start
  247.  
  248.  
  249. -- part 14 (field)
  250. -- low flags: 01
  251. -- high flags: 0000
  252. -- rect: left=189 top=98 right=124 bottom=224
  253. -- title width / last selected line: 0
  254. -- icon id / first selected line: 0 / 0
  255. -- text alignment: 0
  256. -- font id: 3
  257. -- text size: 12
  258. -- style flags: 0
  259. -- line height: 16
  260. -- part name: Word1 Correct
  261.  
  262.  
  263. -- part 8 (field)
  264. -- low flags: 01
  265. -- high flags: 0001
  266. -- rect: left=278 top=64 right=85 bottom=320
  267. -- title width / last selected line: 0
  268. -- icon id / first selected line: 0 / 0
  269. -- text alignment: 1
  270. -- font id: 3
  271. -- text size: 14
  272. -- style flags: 256
  273. -- line height: 18
  274. -- part name: Word1
  275. ----- HyperTalk script -----
  276. on mouseDown
  277.   moveMe "Word1 Start", "Word1 Correct"
  278. end mouseDown
  279.  
  280.  
  281. -- part 15 (field)
  282. -- low flags: 01
  283. -- high flags: 0000
  284. -- rect: left=252 top=98 right=124 bottom=287
  285. -- title width / last selected line: 0
  286. -- icon id / first selected line: 0 / 0
  287. -- text alignment: 0
  288. -- font id: 3
  289. -- text size: 12
  290. -- style flags: 0
  291. -- line height: 16
  292. -- part name: Word2 Correct
  293.  
  294.  
  295. -- part 16 (field)
  296. -- low flags: 01
  297. -- high flags: 0000
  298. -- rect: left=452 top=98 right=124 bottom=487
  299. -- title width / last selected line: 0
  300. -- icon id / first selected line: 0 / 0
  301. -- text alignment: 0
  302. -- font id: 3
  303. -- text size: 12
  304. -- style flags: 0
  305. -- line height: 16
  306. -- part name: Word3 Correct
  307.  
  308.  
  309. -- part 9 (field)
  310. -- low flags: 01
  311. -- high flags: 0001
  312. -- rect: left=338 top=64 right=85 bottom=393
  313. -- title width / last selected line: 0
  314. -- icon id / first selected line: 0 / 0
  315. -- text alignment: 1
  316. -- font id: 3
  317. -- text size: 14
  318. -- style flags: 256
  319. -- line height: 18
  320. -- part name: Word2
  321. ----- HyperTalk script -----
  322. on mouseDown
  323.   moveMe "Word2 Start", "Word2 Correct"
  324. end mouseDown
  325.  
  326.  
  327. -- part 10 (field)
  328. -- low flags: 01
  329. -- high flags: 0001
  330. -- rect: left=210 top=64 right=85 bottom=261
  331. -- title width / last selected line: 0
  332. -- icon id / first selected line: 0 / 0
  333. -- text alignment: 1
  334. -- font id: 3
  335. -- text size: 14
  336. -- style flags: 256
  337. -- line height: 18
  338. -- part name: Word3
  339. ----- HyperTalk script -----
  340. on mouseDown
  341.   moveMe "Word3 Start", "Word3 Correct"
  342. end mouseDown
  343.  
  344.  
  345. -- part 21 (field)
  346. -- low flags: 01
  347. -- high flags: 0000
  348. -- rect: left=119 top=137 right=159 bottom=178
  349. -- title width / last selected line: 0
  350. -- icon id / first selected line: 0 / 0
  351. -- text alignment: 0
  352. -- font id: 3
  353. -- text size: 12
  354. -- style flags: 0
  355. -- line height: 16
  356. -- part name: Alph3 Start
  357.  
  358.  
  359. -- part 27 (field)
  360. -- low flags: 01
  361. -- high flags: 0000
  362. -- rect: left=119 top=162 right=184 bottom=178
  363. -- title width / last selected line: 0
  364. -- icon id / first selected line: 0 / 0
  365. -- text alignment: 0
  366. -- font id: 3
  367. -- text size: 12
  368. -- style flags: 0
  369. -- line height: 16
  370. -- part name: Alph4 Start
  371.  
  372.  
  373. -- part 28 (field)
  374. -- low flags: 01
  375. -- high flags: 0000
  376. -- rect: left=181 top=137 right=159 bottom=240
  377. -- title width / last selected line: 0
  378. -- icon id / first selected line: 0 / 0
  379. -- text alignment: 0
  380. -- font id: 3
  381. -- text size: 12
  382. -- style flags: 0
  383. -- line height: 16
  384. -- part name: Alph1 Start
  385.  
  386.  
  387. -- part 29 (field)
  388. -- low flags: 01
  389. -- high flags: 0000
  390. -- rect: left=181 top=162 right=184 bottom=240
  391. -- title width / last selected line: 0
  392. -- icon id / first selected line: 0 / 0
  393. -- text alignment: 0
  394. -- font id: 3
  395. -- text size: 12
  396. -- style flags: 0
  397. -- line height: 16
  398. -- part name: Alph2 Start
  399.  
  400.  
  401. -- part 30 (field)
  402. -- low flags: 01
  403. -- high flags: 0002
  404. -- rect: left=253 top=149 right=171 bottom=312
  405. -- title width / last selected line: 0
  406. -- icon id / first selected line: 0 / 0
  407. -- text alignment: 0
  408. -- font id: 3
  409. -- text size: 12
  410. -- style flags: 0
  411. -- line height: 16
  412. -- part name: Alph1 Correct
  413.  
  414.  
  415. -- part 31 (field)
  416. -- low flags: 01
  417. -- high flags: 0002
  418. -- rect: left=317 top=149 right=171 bottom=376
  419. -- title width / last selected line: 0
  420. -- icon id / first selected line: 0 / 0
  421. -- text alignment: 0
  422. -- font id: 3
  423. -- text size: 12
  424. -- style flags: 0
  425. -- line height: 16
  426. -- part name: Alph2 Correct
  427.  
  428.  
  429. -- part 32 (field)
  430. -- low flags: 01
  431. -- high flags: 0002
  432. -- rect: left=380 top=149 right=171 bottom=439
  433. -- title width / last selected line: 0
  434. -- icon id / first selected line: 0 / 0
  435. -- text alignment: 0
  436. -- font id: 3
  437. -- text size: 12
  438. -- style flags: 0
  439. -- line height: 16
  440. -- part name: Alph3 Correct
  441.  
  442.  
  443. -- part 33 (field)
  444. -- low flags: 01
  445. -- high flags: 0002
  446. -- rect: left=443 top=149 right=171 bottom=502
  447. -- title width / last selected line: 0
  448. -- icon id / first selected line: 0 / 0
  449. -- text alignment: 0
  450. -- font id: 3
  451. -- text size: 12
  452. -- style flags: 0
  453. -- line height: 16
  454. -- part name: Alph4 Correct
  455.  
  456.  
  457. -- part 34 (field)
  458. -- low flags: 01
  459. -- high flags: 0000
  460. -- rect: left=183 top=139 right=157 bottom=237
  461. -- title width / last selected line: 0
  462. -- icon id / first selected line: 0 / 0
  463. -- text alignment: 1
  464. -- font id: 0
  465. -- text size: 12
  466. -- style flags: 0
  467. -- line height: 16
  468. -- part name: Alph1
  469. ----- HyperTalk script -----
  470. on mouseDown
  471.   alphabetize short name of me
  472. end mouseDown
  473.  
  474.  
  475. -- part 35 (field)
  476. -- low flags: 01
  477. -- high flags: 0000
  478. -- rect: left=121 top=164 right=182 bottom=175
  479. -- title width / last selected line: 0
  480. -- icon id / first selected line: 0 / 0
  481. -- text alignment: 1
  482. -- font id: 0
  483. -- text size: 12
  484. -- style flags: 0
  485. -- line height: 16
  486. -- part name: Alph4
  487. ----- HyperTalk script -----
  488. on mouseDown
  489.   alphabetize short name of me
  490. end mouseDown
  491.  
  492.  
  493. -- part 36 (field)
  494. -- low flags: 01
  495. -- high flags: 0000
  496. -- rect: left=121 top=139 right=157 bottom=175
  497. -- title width / last selected line: 0
  498. -- icon id / first selected line: 0 / 0
  499. -- text alignment: 1
  500. -- font id: 0
  501. -- text size: 12
  502. -- style flags: 0
  503. -- line height: 16
  504. -- part name: Alph3
  505. ----- HyperTalk script -----
  506. on mouseDown
  507.   alphabetize short name of me
  508. end mouseDown
  509.  
  510.  
  511. -- part 37 (field)
  512. -- low flags: 01
  513. -- high flags: 0000
  514. -- rect: left=183 top=164 right=182 bottom=237
  515. -- title width / last selected line: 0
  516. -- icon id / first selected line: 0 / 0
  517. -- text alignment: 1
  518. -- font id: 0
  519. -- text size: 12
  520. -- style flags: 0
  521. -- line height: 16
  522. -- part name: Alph2
  523. ----- HyperTalk script -----
  524. on mouseDown
  525.   alphabetize short name of me
  526. end mouseDown
  527.  
  528.  
  529. -- part contents for card part 8
  530. ----- text -----
  531. rain     
  532.  
  533. -- part contents for card part 9
  534. ----- text -----
  535. Spain
  536.  
  537. -- part contents for card part 10
  538. ----- text -----
  539. plain
  540.  
  541. -- part contents for card part 34
  542. ----- text -----
  543. Apple
  544.  
  545. -- part contents for card part 35
  546. ----- text -----
  547. Zebra
  548.  
  549. -- part contents for card part 36
  550. ----- text -----
  551. Worm
  552.  
  553. -- part contents for card part 37
  554. ----- text -----
  555. Frog